Deploying Kanzi applications to i.MX6/INTEGRITY

Here you can find how to deploy your Kanzi application to i.MX6 SABRE platform running the INTEGRITY real-time operating system. Kanzi supports this platform since version 2.7.1 and is tested to work with MULTI IDE version 6.1.4 running under Debian GNU/Linux version 6.0.7.

i.MX6/INTEGRITY libraries required for deploying Kanzi applications to i.MX6/INTEGRITY are supplied with Kanzi on request. Contact Rightware sales at sales@rightware.com to find out more.

Prerequisites

Before you can build and deploy Kanzi applications you need a working INTEGRITY development environment for i.MX6 SABRE including:

For information on how to set up the INTEGRITY development environment, see i.MX6 SABRE Lite BSP User's Guide provided by Green Hills Software.

In addition to the working INTEGRITY development environment, you need:

Before you start deploying Kanzi applications to i.MX6/INTEGRITY, make sure you can successfully deploy and run one of the OpenGL examples provided with the GPU support package.

Note that the examples here assume that your development environment is installed in /opt/sdk/ghs/ and that the TFTP server is serving files from the directory /srv/tftp/.

Preparing a memory card

Kanzi application reads the assets and scene description exported from Kanzi Studio from the file system of a memory card. This can be the same memory card that hosts the U-Boot bootloader. Prepare a FAT- formatted memory card and make sure you can easily swap the card between your desktop computer and the target board.

Preparing for the Kanzi application development

Kanzi development files are provided as a compressed archive. If you received the i.MX6/INTEGRITY support files as a separate package, copy the contents of the package to <KanziWorkspace>/Engine.

The package contains a minimal example project called kzb_player you can use as a template for new Kanzi applications. To load this example project to the appropriate default project for your i.MX6 target, add to openGL.gpj:

../kzb_player/configs/platforms/integrity-arm/kzb_player.gpj [INTEGRITY Application]

Open kzb_player_as0.gpj and edit the macro KZ_ENGINE_DIR to point to your Kanzi Engine installation directory. For example:

macro KZ_ENGINE_DIR=/home/buildserver/workspace/v2_7/Kanzi/Engine

The project compiles without errors when you load it correctly.

Special code considerations

When developing Kanzi applications for i.MX6/INTEGRITY, keep in mind that you must call these INTEGRITY-specific functions no later than the onConfigure():

The kzb_player example calls these functions by default.

Compiling and creating a U-Boot image

If you are deploying your Kanzi application for the first time, or if you made changes to the program code:

  1. In the MULTI IDE compile the application and kernel by selecting kzb_player.gpj and clicking the compile button (crossed wrench and hammer).
  2. Prepare the image using gmemfile. This produces a file called kzb_player.bin.
  3. Create the final U-Boot image using mkimage. This produces a file called kzb_player.uimage in the TFTP server directory.

You can achieve the last two steps by using this script:

#!/bin/sh
/opt/sdk/ghs/comp_201314/gmemfile kzb_player && \
mkimage -A arm -O linux -C none -a 10800000 -n INTEGRITY -d kzb_player.bin /srv/tftp/kzb_player.uimage

If your target device supports compressed images, you can save some time by creating a zimage instead:

#!/bin/sh
/opt/sdk/ghs/comp_201314/gmemfile kzb_player && \
gzip -f kzb_player.bin && \
mkimage -A arm -O linux -C gzip -a 10800000 -n INTEGRITY -d kzb_player.bin.gz \
/srv/tftp/kzb_player.zimage

Exporting to the Memory Card

When you change your Kanzi application in Kanzi Studio, export a new kzb binary to the memory card. Before you deploy your Kanzi application, the memory card must contain:

Connect the memory card to the target board before powering up the board.

Deploying your Kanzi application

You can deploy and boot a U-boot image by executing these commands in the U-Boot bootloader:

tftp 70000000 kzb_player.uimage
bootm 70000000

To save time, you can store these commands to the U-Boot environment to be issued at power up. The exact deployment address (in this case 0x70000000) is target specific. Contact your hardware vendor for more information.

While the kernel is booting, look for these important log messages:

Log message Meaning
USB..............................Success The USB subsystem is initialized. Kanzi uses USB for mouse and keyboard input.
GALcore 4.6.9.1210 (Jul 31 2013).................Success The graphics driver is initialized
VFS: Mounting SDCardDev:a on / with options: update,rw Shows where the SD card is mounted. The path shown (in this case /) must match the path given to kzsFileBaseSetResourceDirectory() during the application startup.

Starting the debugger

Once the image is booted, to attach the debugger using the rtserv2 protocol in the MULTI IDE go to Main > Connect > rtserv2.
The debugger window opens when the connection is established.

Start the application by selecting the newly created initial process under kzb_player_as0 and clicking the green arrow button.

Switching between debug and release builds

You can set whether to use debug or release build in the kzb_player_as0.gpj:

After switching the builds, you have to recompile and redeploy the application.

Note that Kanzi documentation refers to Kanzi libraries by names libsystem, libcore, libuser and libapplicationframework. These are renamed to libkzsystem, libkzcore, libkzuser and libkzapplicationframework for the i.MX6/INTEGRITY port to avoid name clashes with existing libraries.

See also

Deploying Kanzi applications

Using kzb files